<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件

// 二维数组去重
function arr_unique($arr2d){

    $temp = [];
    foreach ($arr2d as $v) {
        $v = join(",", $v); //降维,也可以用implode,将一维数组转换为用逗号连接的字符串
        $temp[] = $v;
    }
    if($temp){
	    $temp = array_unique($temp);//去掉重复的字符串,也就是重复的一维数组
	    foreach ($temp as $k => $v) {
	        $temp[$k] = explode(",", $v);//再将拆开的数组重新组装
	    }
    	return $temp;
    }

}